package com.guochuang.yunwang.promanager.dao;

import com.guochuang.yunwang.promanager.domain.UserGroup;
import com.guochuang.yunwang.promanager.domain.dto.group.GroupManageDTO;
import com.guochuang.yunwang.promanager.domain.vo.group.GroupUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserGroupMapper {
    public Integer addUserGroup(UserGroup userGroup);

    public Integer updateUserGroup(UserGroup userGroup);

    public UserGroup getUserGroupByGId(Integer gid);

    public List<Integer> selectAllRidsByGid(Integer gid);

    public List<GroupManageDTO> selectGroupManageDTOsInGroupByGid(Integer gid);

    public List<GroupManageDTO> selectAllGroupManageDTOs();

    public List<Integer> selectAllUidsInGroupByGroupId(Integer id);

    Integer deleteGroupUserByGid(Integer gid);

    Integer addUsersToGroup(@Param(value = "gid") Integer gid,
                            @Param(value = "uids") List<Integer> uids);

    Integer updateGroupNums(@Param(value = "gid") Integer gid,
                            @Param(value = "size") Integer size);

    List<GroupUserVO> getGroupUserLists(Integer gid);

    Integer deleteGroupUser(@Param(value = "gid") Integer gid,
                            @Param(value = "uid") Integer uid);

    Integer updateGroupUserRole(@Param(value = "uid") Integer uid,
                                @Param(value = "gid") Integer gid,
                                @Param(value = "rid") Integer rid);

    List<Integer> getGroupUserIdList(Integer gid);

    Integer deleteGroupUserList(@Param(value = "gid") Integer gid,
                                @Param(value = "deluids") List<Integer> deluids);
}
